using System.Runtime.InteropServices.JavaScript;

namespace ConsoleApp1;

public class Demo
{
    public void Test()
    {
        int[] a = new int[3];
        for (int i = 0; i < 3; i++)
        {
            a[i] = Convert.ToInt32(Console.ReadLine());
        }
        for (int i = 0; i < 3; i++)
        {
            for (int j = i; j < 3; j++)
            {
                if (a[i] > a[j])
                {
                    int temp = a[i];
                    a[i] = a[j];
                    a[j] = temp;
                }
            }
        }

        for (int i = 0; i < 3; i++)
        {
            Console.WriteLine(a[i]);
        }
    }

    public void Test2()
    {
        int count = 0;
        for (int i = 1; i <= 100; i++)
        {
            int ge = i % 10;
            int shi = i / 10 % 10;
            if (ge == 7 || shi == 7)
            {
                count += i;
                Console.WriteLine(i);
            }
            else if (i % 7 == 0)
            {
                count += i;
                Console.WriteLine(i);
            }
        }
    }

    public void Test3()
    {
        for (int i = 1; i <= 9; i++)
        {
            for (int j = 1; j <= 9; j++)
            {
                Console.WriteLine("i*j={i*j}");
            }
        }
    }

    public void Test4()
    {
        int zhen(int a)
        {
            int count = 0;
            for (int i = 1; i < a; i++)
            {
                if (a % i == 0)
                {
                    count += i;
                }
            }

            return count;
        }
        for (int i = 1; i <= 1000; i++)
        {
            if (i == zhen(i))
            {
                Console.WriteLine(i);
            }
        }
    }

    public void Test5()
    {
        char[] a = Console.ReadLine().ToCharArray();
        Console.WriteLine(a.Length);
        int n = 0;
        for (int i = a.Length - 1; i >= 0; i--)
        {
            if (a.Length == 1)
            {
                Console.WriteLine(a[0]-'0');
                return;
            }
            else
            {
                n = n*10+(a[i]-'0');
            }
        }
        Console.WriteLine(n);
    }

    public void Test6()
    {
        int m = Convert.ToInt32(Console.ReadLine());
        for (int i = 1; i <= m; i++)
        {
            for (int j = m-i; j <= m-1; j++)
            {
                Console.WriteLine(' ');
            }

            for (int k = i; k <= m; k++)
            {
                Console.WriteLine('*');
            }
            Console.WriteLine('\n');
        }

        for (int i = 1; i <= m - 1; i++)
        {
            for (int j = m-i; j <= m; j++)
            {
                Console.WriteLine(' ');
            }

            for (int k = i; k <= m; k++)
            {
                Console.WriteLine('*');
            }
        }
    }
    public static void Main(string[] args)
    {
        Demo p = new Demo();
        p.Test();
        p.Test2();
        p.Test3();
        p.Test4();
        p.Test5();
        p.Test6();
    }
}